Optimal. Leaf size=72 \[ \frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {2} \sqrt {a+a \sin (c+d x)}}\right )}{\sqrt {a} d}-\frac {2 \cos (c+d x)}{d \sqrt {a+a \sin (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2830, 2728,
212} \begin {gather*} \frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {2} \sqrt {a \sin (c+d x)+a}}\right )}{\sqrt {a} d}-\frac {2 \cos (c+d x)}{d \sqrt {a \sin (c+d x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2728
Rule 2830
Rubi steps
\begin {align*} \int \frac {\sin (c+d x)}{\sqrt {a+a \sin (c+d x)}} \, dx &=-\frac {2 \cos (c+d x)}{d \sqrt {a+a \sin (c+d x)}}-\int \frac {1}{\sqrt {a+a \sin (c+d x)}} \, dx\\ &=-\frac {2 \cos (c+d x)}{d \sqrt {a+a \sin (c+d x)}}+\frac {2 \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (c+d x)}{\sqrt {a+a \sin (c+d x)}}\right )}{d}\\ &=\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (c+d x)}{\sqrt {2} \sqrt {a+a \sin (c+d x)}}\right )}{\sqrt {a} d}-\frac {2 \cos (c+d x)}{d \sqrt {a+a \sin (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.07, size = 98, normalized size = 1.36 \begin {gather*} -\frac {2 \left ((1+i) (-1)^{3/4} \tanh ^{-1}\left (\left (\frac {1}{2}+\frac {i}{2}\right ) (-1)^{3/4} \left (-1+\tan \left (\frac {1}{4} (c+d x)\right )\right )\right )+\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d \sqrt {a (1+\sin (c+d x))}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.77, size = 96, normalized size = 1.33
method | result | size |
default | \(-\frac {\left (1+\sin \left (d x +c \right )\right ) \sqrt {-a \left (\sin \left (d x +c \right )-1\right )}\, \left (-\sqrt {a}\, \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )+2 \sqrt {a -a \sin \left (d x +c \right )}\right )}{a \cos \left (d x +c \right ) \sqrt {a +a \sin \left (d x +c \right )}\, d}\) | \(96\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 191 vs.
\(2 (61) = 122\).
time = 0.34, size = 191, normalized size = 2.65 \begin {gather*} \frac {\frac {\sqrt {2} {\left (a \cos \left (d x + c\right ) + a \sin \left (d x + c\right ) + a\right )} \log \left (-\frac {\cos \left (d x + c\right )^{2} - {\left (\cos \left (d x + c\right ) - 2\right )} \sin \left (d x + c\right ) + \frac {2 \, \sqrt {2} \sqrt {a \sin \left (d x + c\right ) + a} {\left (\cos \left (d x + c\right ) - \sin \left (d x + c\right ) + 1\right )}}{\sqrt {a}} + 3 \, \cos \left (d x + c\right ) + 2}{\cos \left (d x + c\right )^{2} - {\left (\cos \left (d x + c\right ) + 2\right )} \sin \left (d x + c\right ) - \cos \left (d x + c\right ) - 2}\right )}{\sqrt {a}} - 4 \, \sqrt {a \sin \left (d x + c\right ) + a} {\left (\cos \left (d x + c\right ) - \sin \left (d x + c\right ) + 1\right )}}{2 \, {\left (a d \cos \left (d x + c\right ) + a d \sin \left (d x + c\right ) + a d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sin {\left (c + d x \right )}}{\sqrt {a \left (\sin {\left (c + d x \right )} + 1\right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 118, normalized size = 1.64 \begin {gather*} -\frac {\frac {\sqrt {2} \log \left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{\sqrt {a} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} - \frac {\sqrt {2} \log \left (-\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{\sqrt {a} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} - \frac {4 \, \sqrt {2} \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.75, size = 99, normalized size = 1.38 \begin {gather*} -\frac {\left (4\,\mathrm {E}\left (\mathrm {asin}\left (\frac {\sqrt {2}\,\sqrt {1-\sin \left (c+d\,x\right )}}{2}\right )\middle |1\right )-2\,\mathrm {F}\left (\mathrm {asin}\left (\frac {\sqrt {2}\,\sqrt {1-\sin \left (c+d\,x\right )}}{2}\right )\middle |1\right )\right )\,\sqrt {{\cos \left (c+d\,x\right )}^2}\,\sqrt {\frac {a+a\,\sin \left (c+d\,x\right )}{2\,a}}}{d\,\cos \left (c+d\,x\right )\,\sqrt {a+a\,\sin \left (c+d\,x\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________